username and password validation in python